﻿/****** Object:  Table [dbo].[BugDependency]    Script Date: 08/18/2011 15:58:08 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[BugDependency](
	[BugDependencyId] [int] IDENTITY(1,1) NOT NULL,
	[BugId] [int] NOT NULL,
	[ParentId] [int] NOT NULL,
 CONSTRAINT [PK_BugDependency] PRIMARY KEY CLUSTERED 
(
	[BugDependencyId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[BugDependency]  WITH CHECK ADD  CONSTRAINT [FK_BugDependency_Bug] FOREIGN KEY([BugId])
REFERENCES [dbo].[Bug] ([BugId])
GO

ALTER TABLE [dbo].[BugDependency] CHECK CONSTRAINT [FK_BugDependency_Bug]
GO

ALTER TABLE [dbo].[BugDependency]  WITH CHECK ADD  CONSTRAINT [FK_BugDependency_Parent] FOREIGN KEY([ParentId])
REFERENCES [dbo].[Bug] ([BugId])
GO

ALTER TABLE [dbo].[BugDependency] CHECK CONSTRAINT [FK_BugDependency_Parent]
GO


